package com.stu.day02;

/**
 * @author zy
 * @date 2025/1/23 19:34
 */
public class MethodDemo {
    private String m = "普通变量";
    private static String n = "静态变量";


    public static void main(String[] args) {
        MethodDemo md = new MethodDemo();
        md.method2();

    }

    private static void method1(){
        System.out.println("静态方法");
        System.out.println(n);  //静态方法中只能调用静态变量
    }

    private void method2(){
        System.out.println("普通方法");
        method1();  //普通方法中可以调用静态方法
        System.out.println(m);
        System.out.println(n);  //普通方法中可以调用静态变量
    }
}
